package com.finance.controller;

import com.finance.config.Result;
import com.finance.model.entity.TempLog;
import com.finance.service.impl.TempLogServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 邓天天
 * @date 2021/6/17 10:39
 */

@RestController
@RequestMapping("/templog")
public class TempLogController {

    @Autowired
    TempLogServiceImpl tempLogService;

    @PostMapping("/save")
    public Result<String> save(@RequestBody List<TempLog> tempLogList) {
        tempLogService.saveBatch(tempLogList);
        return Result.success("成功");
    }

    @GetMapping("/list")
    public Result<List<TempLog>> list() {
        return Result.success(tempLogService.list());
    }

}
